using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class QuestionMap : EntityTypeConfiguration<Question>
    {
        public QuestionMap()
        {
            // Primary Key
            this.HasKey(t => t.Q_ID);

            // Properties
            this.Property(t => t.Q_Number)
                .HasMaxLength(50);

            this.Property(t => t.Q_Content)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("Question");
            this.Property(t => t.Q_ID).HasColumnName("Q_ID");
            this.Property(t => t.Q_Number).HasColumnName("Q_Number");
            this.Property(t => t.Q_Content).HasColumnName("Q_Content");
        }
    }
}
